fix(form): recognize Horde\{App}\...\FooVariable in BaseVariable::getTypeName()#45
Merged
Merged
Conversation
…TypeName()
Restores {app}_form_type_{name} mapping for vendor-namespaced app variables
so legacy Horde_Core_Ui_VarRenderer dispatch still finds the app's
_renderVarInput_* methods. Surfaced by horde/ingo#34.
🔍 CI ResultsOverall: ❌ 6/12 lanes failed TL;DR: ❌ Quality issues: PHPStan: 5 unique errors in 6 lanes. Summary by PHP Version
Quality Metrics
❌ Failed Lanesphp8.3-dev
php8.3-stable
php8.4-dev
php8.4-stable
php8.5-dev
php8.5-stable
CI powered by horde-components • View full results |
ralflang
added a commit
that referenced
this pull request
Jul 4, 2026
Release version 3.1.1 Merge pull request #45 from horde/fix/vendor-namespaced-gettypename fix(form): recognize Horde\{App}\...\FooVariable in BaseVariable::getTypeName()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BaseVariable::getTypeName()derives a variable's legacy type handle from its class namespace.Horde_Core_Ui_VarRenderer::render()uses that handle to dispatch to_renderVarInput_{typename}methods on app-provided renderers.Before this change the derivation covered two shapes:
Horde\Form\V3\TextVariable→text(vendor)Ingo\Form\V3\FoldersVariable→ingo_form_type_folders(legacy pre-PSR-4 app)A vendor-namespaced app variable —
Horde\Ingo\Form\V3\FoldersVariable, the shape that horde/form 3.1's FQCN support encourages apps to migrate to — collapsed to justfolders, so the legacy renderer method_renderVarInput_ingo_form_type_folderswas never dispatched and users saw "Unknown variable type" warnings on the affected screens.getTypeName()now recognizes all three shapes:Horde\Form\V3\TextVariabletextIngo\Form\V3\FoldersVariableingo_form_type_foldersHorde\Ingo\Form\V3\FoldersVariableingo_form_type_foldersDetection is
parts[0] === 'Horde' && parts[1] !== 'Form'→ vendor-namespaced app, prefix withstrtolower(parts[1]) . '_form_type_'.Existing
testGetTypeName()covers the vendor path unchanged. Two new cases inV3BaseVariableTestexercise the vendor-namespaced and legacy app paths using stub Variable classes declared intest/v3/fixtures/GetTypeNameFixtures.php(PSR-4 intest/is mapped toHorde\Form\Test\, so the fixture file uses bracketed namespace blocks and is loaded from the existing bootstrap).Surfaced by horde/ingo#34, which moves ingo's custom Variable classes from
Ingo\Form\V3toHorde\Ingo\Form\V3. Ingo has a localgetTypeName()override in place to unblock that PR; once this ships those overrides become optional.